<template>
    <div>
        <div>me</div>
        <button @click="goHome">返回About页面</button>
    </div>
</template>

<script>
    export default {
        name: "Me",
        methods: {
            goHome() {
                //编程式导航，返回/about页面
                this.$router.push({path: "/about"})
            }
        },
        beforeRouteEnter(to, form, next) {
            console.log("beforeRouteEnter");
            next()
        },
        beforeRouteUpdate(to, form, next) {
            console.log("beforeRouteUpdate");
        },
        beforeRouteLeave(to, form, next) {
            console.log("beforeRouteLeave");
            next()
        },
    }
</script>

<style scoped>

</style>
